﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NerdDinner.Data.Entities;

namespace NerdDinner.Data.Mappings
{
    public class WalkMap : ClassMap<Walk>
    {
        public WalkMap()
        {
            Id(x => x.WalkId)
                .GeneratedBy.Increment()
                .Column("WalkId");
            Map(x => x.WalkTitle).Not.Nullable();
            Map(x => x.WalkDescription);
            Map(x => x.WalkDate).Not.Nullable();
            Map(x => x.WalkEndDate);
            Map(x => x.RefOrginizerId);
            Map(x => x.lat, "StartLatitude");
            Map(x => x.lng, "StartLongitude");
            Not.LazyLoad();
            References(x => x.WalkCategory).Column("WalkCategory_Id");
            References(x => x.Point);
        }
    }
}
